package com.ruoyi.tbm.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tbm.mapper.TbmEquipmentMapper;
import com.ruoyi.tbm.domain.TbmEquipment;
import com.ruoyi.tbm.service.ITbmEquipmentService;

/**
 * 盾构机配件Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-13
 */
@Service
public class TbmEquipmentServiceImpl implements ITbmEquipmentService 
{
    @Autowired
    private TbmEquipmentMapper tbmEquipmentMapper;

    /**
     * 查询盾构机配件
     * 
     * @param id 盾构机配件主键
     * @return 盾构机配件
     */
    @Override
    public TbmEquipment selectTbmEquipmentById(Integer id)
    {
        return tbmEquipmentMapper.selectTbmEquipmentById(id);
    }

    /**
     * 查询盾构机配件列表
     * 
     * @param tbmEquipment 盾构机配件
     * @return 盾构机配件
     */
    @Override
    public List<TbmEquipment> selectTbmEquipmentList(TbmEquipment tbmEquipment)
    {
        return tbmEquipmentMapper.selectTbmEquipmentList(tbmEquipment);
    }

    /**
     * 新增盾构机配件
     * 
     * @param tbmEquipment 盾构机配件
     * @return 结果
     */
    @Override
    public int insertTbmEquipment(TbmEquipment tbmEquipment)
    {
        tbmEquipment.setCreateDate(new Date());
        return tbmEquipmentMapper.insertTbmEquipment(tbmEquipment);
    }

    /**
     * 修改盾构机配件
     * 
     * @param tbmEquipment 盾构机配件
     * @return 结果
     */
    @Override
    public int updateTbmEquipment(TbmEquipment tbmEquipment)
    {
        tbmEquipment.setModifyDate(new Date());
        return tbmEquipmentMapper.updateTbmEquipment(tbmEquipment);
    }

    /**
     * 批量删除盾构机配件
     * 
     * @param ids 需要删除的盾构机配件主键
     * @return 结果
     */
    @Override
    public int deleteTbmEquipmentByIds(Integer[] ids)
    {
        return tbmEquipmentMapper.deleteTbmEquipmentByIds(ids);
    }

    /**
     * 删除盾构机配件信息
     * 
     * @param id 盾构机配件主键
     * @return 结果
     */
    @Override
    public int deleteTbmEquipmentById(Integer id)
    {
        return tbmEquipmentMapper.deleteTbmEquipmentById(id);
    }
}
